﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Runtime.Serialization;
using System.Web;

namespace AgileNYCWebService.Manager.Data.Table
{
	public class Events:BaseClass
	{
		public Events()
			: this(null)
		{

		}

		public Events(DataRow row):base(row)
		{
			if (row != null)
			{
				if (row.Table.Columns.Contains("Topic"))
					Topic = row["Topic"].GetString(string.Empty);
				if (row.Table.Columns.Contains("Introduction"))
					Introduction = row["Introduction"].GetString(string.Empty);
				if (row.Table.Columns.Contains("Author"))
					Author = row["Author"].GetString(string.Empty);
				if (row.Table.Columns.Contains("Room"))
					Room = row["Room"].GetString(string.Empty);
				if (row.Table.Columns.Contains("StartTime"))
					StartTime = row["StartTime"].GetDateTime(default(DateTime));
				if (row.Table.Columns.Contains("EndTime"))
					EndTime = row["EndTime"].GetDateTime(default(DateTime));
				if (row.Table.Columns.Contains("AuthorImageUrl"))
					AuthorImageUrl = row["AuthorImageUrl"].GetString(string.Empty);
				if (row.Table.Columns.Contains("IsCheckIn"))
					IsCheckIn = row["IsCheckIn"].GetBoolean(false);
				if (row.Table.Columns.Contains("UserRating"))
					UserRating = row["UserRating"].GetDouble(0.0);
				if (row.Table.Columns.Contains("AvgRating"))
					AvgRating = row["AvgRating"].GetDouble(0.0);
			}
		}
		
		public string Topic { get; set; }
		public string Introduction { get; set; }
		public string Author { get; set; }
		public string Room { get; set; }
		public DateTime StartTime { get; set; }
		public DateTime EndTime { get; set; }
		public string AuthorImageUrl { get; set; }
		public bool IsCheckIn { get; set; }
		public double UserRating { get; set; }
		public double AvgRating { get; set; }
	}
}